using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;

namespace EventAbstractionAPI.RuleEngine
{
    public class CapturedEvent : ICapturedEvent
	{
        public CapturedEvent()
        {

        }

        public CapturedEvent(String complexName)
        {
            _complexName = complexName;
        }

        #region ICapturedEvent Members

        public List<EventArgs> EventArgumentsList
        {
            get { return _args; }
            set { _args = value; }
        }

        public String EventName
        {
            get { return _eventName; }
            set { _eventName = value; }
        }

        /// <summary>
        /// The time when the event first occured.
        /// </summary>
        public DateTime EventTimeStamp
        {
            get 
            {
                //check to see if the time stamp has been given, if it is the same or less than then it hasn't been assigned to by the user
                //CompareTO() outputs:
                                        //less than 0 = less than
                                        //0 = equal
                                        //greater than 0 = greater than -or- value is null

                if (new DateTime().CompareTo(_eventTimeStamp) > 0)
                {
                    throw new Exception("Event Time Stamp Value not specified.");
                }
                return _eventTimeStamp; 
            }

            set { _eventTimeStamp = value; }
        }

        public string ComplexName
        {
            get
            {
                return _complexName;
            }
            set
            {
                _complexName = value;
            }
        }

        public object Sender
        {
            get
            {
                return _sender;
            }
            set
            {
                _sender = value;
            }
        }

        #endregion

        String _complexName = "";
        String _eventName = "";
        DateTime _eventTimeStamp = new DateTime();
        List<EventArgs> _args = new List<EventArgs>();
        object _sender = new object();

    }
}
